<template>
  <div>
    <h3>Home组件</h3>
    <button @click="news">新闻</button>
    <button @click="game">游戏</button>
    <button @click="movie">电影</button>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: "Home",
  methods: {
    news() {
      // 字符串
      this.$router.push("/home/new");
    },
    game() {
      // 或者对象类型参数，对象中书写 path属性代表完整地址
      this.$router.push({
        path: "/home/game",
      });
    },
    movie() {
      this.$router.push("/home/movie");
    },
  },
};
</script>

<style></style>
